import request from '@/utils/request'

// 查询试卷列表
export function listPapers(query) {
  return request({
    url: '/answer/papers/list',
    method: 'get',
    params: query
  })
}

// 查询试卷详细
export function getPapers(id) {
  return request({
    url: '/answer/papers/' + id,
    method: 'get'
  })
}

// 新增试卷
export function addPapers(data) {
  return request({
    url: '/answer/papers',
    method: 'post',
    data: data
  })
}

// 修改试卷
export function updatePapers(data) {
  return request({
    url: '/answer/papers',
    method: 'put',
    data: data
  })
}

// 删除试卷
export function delPapers(id) {
  return request({
    url: '/answer/papers/' + id,
    method: 'delete'
  })
}
//新增试卷详情 /answer/papers/addDetail
export function addDetail(data) {
  return request({
    url: '/answer/papers/addDetail',
    method: 'post',
    data: data
  })
}

///answer/papers/getDetail
export function getDetail(id) {
  return request({
    url: '/answer/papers/getDetail?paperId=' + id,
    method: 'get'
  })
}
///answer/choice/{ids}

export function del(ids) {
  return request({
    url: `answer/questions/${ids}`,
    method: 'delete'
  })
}

export function delChoice(ids) {
  return request({
    url: `answer/choice/${ids}`,
    method: 'delete'
  })
}